package com.jsy.mini12306.ticketsales.vo;

import com.jsy.mini12306.common.entity.Passenger;
import com.jsy.mini12306.common.entity.Train;
import com.jsy.mini12306.common.entity.TrainPassStation;
import com.jsy.mini12306.ticketsales.bo.DrivingPlan;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author: SongyangJi
 * @description:
 * @since: 2021/9/8
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TicketOrderVO {

    /**
     * 列车
     */
    Train train;
    /**
     * 出发车站
     */
    TrainPassStation departStation;
    /**
     * 到达车站
     */
    TrainPassStation arrivalStation;
    /**
     * 卖家
     */
    Passenger buyer;
    /**
     * 出行日期
     */
    LocalDate departDate;


    List<TicketOrderItermVO> orderIterms;

    public DrivingPlan generateDrivingPlan() {
        return DrivingPlan.builder()
                .train(train)
                .arrivalStation(arrivalStation)
                .departStation(departStation)
                .workingDate(departDate).build();
    }


}
